<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>活动中心</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="../../css/public-heder-Reset.css">
	<link rel="stylesheet" href="../../css/activity-style.css">
</head>
<body>
	<!-- page_box -->
	<div class="page-box">
		<!-- header -->
		<header class="page-header">
			<a href="javascript:history.back(-1);" class="back"></a>
			<p class="pege-name">活动中心</p>
		</header>
		<div class="liubai"></div>
		<!-- header /-->
		<!-- introduce -->
		<div class="introduce">
			<div class="btn">
				<a class="Journalism active">进行中</a>
				<a class="News">已结束</a>
			</div>
		</div>
		<!-- introduce/ -->
		<!-- more-list -->
		<div class="more-list" id="movieList">
			<!-- ajax获取数据 -->
		</div>
		<!-- more-list/ -->
	</div>
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script type="text/javascript" src="../../js/http-url.js"></script>
	<script type="text/javascript" src="../../js/dropload.js"></script>
	<script type="text/javascript">
		$(function(){
			var dataClick=null;
			var load_me;
			loadProject(0,0);
			$('.introduce').find('a').click(function(){
				if (dataClick) {
					return;
				}
			   $('.more-list').html('');
				Animete=null
				if(load_me){
					$(".dropload-down").remove();
					// 锁定
	                load_me.lock();
		              // 无数据
	                load_me.noData();
				}
				var index=$(this).index();
				$('.more-list').html('');
				$('.introduce').find('a').removeClass('active');
				$(this).addClass('active');
				loadProject(index,0)
			});
			function loadProject(projectName,projectsNuber){
			    // dropload
			    $('.page-box').dropload({
			        scrollArea : window,
			        loadDownFn : function(me){
			        	dataClick=true;
			        	load_me=me;
			          ajaxRequest('/api/activity/'+projectName+'/'+projectsNuber+'',true,function(data){
			            // 判断是否加载完毕
			            if(!data.data.activity){
			               // 锁定
			                me.lock();
			              // 无数据
			              me.noData();
			            }
			            $(data.data.activity).appendTo('.more-list');
			            projectsNuber++
			            dataClick=null
			            me.resetload();
			          },false);  
			        },
			        threshold :50
			    },true);
			}
		});
	</script>
</body>
</html>